﻿using System;

namespace XTengine.ComponentModel
{
    public class UInt32Converter : TypeConverter<UInt32>
    {
        public override UInt32 ConvertFrom(string value)
        {
            UInt32 result;
            if (UInt32.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(UInt32 value)
        {
            return value.ToString();
        }
    }
}